package com.svms.service.vo;

import java.io.Serializable;

/**
 * @author om39a
 * 
 */
public class SpareCodesVO implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String spareId;
	public String spareName;

	/**
	 * DST - Distance Validation <br>
	 * DAY - DAys based validation <br>
	 * NA - No validation needed
	 */
	public String validationFormat;
	public String maxDays;
	public String cutOffDays;
	public String maxDistance;
	public String cutOffDistance;

	public String getSpareId() {
		return spareId;
	}

	public void setSpareId(String spareId) {
		this.spareId = spareId;
	}

	public String getSpareName() {
		return spareName;
	}

	public void setSpareName(String spareName) {
		this.spareName = spareName;
	}

	public String getValidationFormat() {
		return validationFormat;
	}

	public void setValidationFormat(String validationFormat) {
		this.validationFormat = validationFormat;
	}

	public String getMaxDays() {
		return maxDays;
	}

	public void setMaxDays(String maxDays) {
		this.maxDays = maxDays;
	}

	public String getCutOffDays() {
		return cutOffDays;
	}

	public void setCutOffDays(String cutOffDays) {
		this.cutOffDays = cutOffDays;
	}

	public String getMaxDistance() {
		return maxDistance;
	}

	public void setMaxDistance(String maxDistance) {
		this.maxDistance = maxDistance;
	}

	public String getCutOffDistance() {
		return cutOffDistance;
	}

	public void setCutOffDistance(String cutOffDistance) {
		this.cutOffDistance = cutOffDistance;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((cutOffDays == null) ? 0 : cutOffDays.hashCode());
		result = prime * result
				+ ((cutOffDistance == null) ? 0 : cutOffDistance.hashCode());
		result = prime * result + ((maxDays == null) ? 0 : maxDays.hashCode());
		result = prime * result
				+ ((maxDistance == null) ? 0 : maxDistance.hashCode());
		result = prime * result + ((spareId == null) ? 0 : spareId.hashCode());
		result = prime * result
				+ ((spareName == null) ? 0 : spareName.hashCode());
		result = prime
				* result
				+ ((validationFormat == null) ? 0 : validationFormat.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SpareCodesVO other = (SpareCodesVO) obj;
		if (cutOffDays == null) {
			if (other.cutOffDays != null)
				return false;
		} else if (!cutOffDays.equals(other.cutOffDays))
			return false;
		if (cutOffDistance == null) {
			if (other.cutOffDistance != null)
				return false;
		} else if (!cutOffDistance.equals(other.cutOffDistance))
			return false;
		if (maxDays == null) {
			if (other.maxDays != null)
				return false;
		} else if (!maxDays.equals(other.maxDays))
			return false;
		if (maxDistance == null) {
			if (other.maxDistance != null)
				return false;
		} else if (!maxDistance.equals(other.maxDistance))
			return false;
		if (spareId == null) {
			if (other.spareId != null)
				return false;
		} else if (!spareId.equals(other.spareId))
			return false;
		if (spareName == null) {
			if (other.spareName != null)
				return false;
		} else if (!spareName.equals(other.spareName))
			return false;
		if (validationFormat == null) {
			if (other.validationFormat != null)
				return false;
		} else if (!validationFormat.equals(other.validationFormat))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "SpareCodesVO [spareId=" + spareId + ", spareName=" + spareName
				+ ", validationFormat=" + validationFormat + ", maxDays="
				+ maxDays + ", cutOffDays=" + cutOffDays + ", maxDistance="
				+ maxDistance + ", cutOffDistance=" + cutOffDistance + "]";
	}

}
